import pygame,sys

class MyBallClass(pygame.sprite.Sprite):
    def init_(self,image_file,speed,location):
     pygame.sprite.Sprite._init_(self)
     self.image=pygame.image.load(image_file)
     self.rest=self.image.get_rest()
     self.rest.left,self.rect.top=location
     self.speed=speed

def move(self):
    global score,score_surf,score_font
    self.rect.move(self.speed)
    if self.rect.left<0 or self.rect.right>screen.get_width():
        self.speed[0]=-self.speed[0]

if  'self.rect.top'<= 0:
    self.speed[1]=-self.apeed[1]
    score=score+1
    score_surf=score_font.render(str(score),1,(0,0,0))